/*
 * $Id: init.c 116f27455c7c 2012/09/12 06:36:10 pgurumur $
 *
 * Copyright (c) 2006, 2007, 2008 Prabhu Gurumurthy <pgurumur@gmail.com>
 *
 * Permission to use, copy, modify, and distribute this software for any
 * purpose with or without fee is hereby granted, provided that the above
 * copyright notice and this permission notice appear in all copies.
 *
 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
 */

/*
 * version "$Revision: 116f27455c7c $"
 * author "$Author: pgurumur $"
 */

#include "svn.h" 

int
Svn_Init(Tcl_Interp *interp)
{
   int retval = TCL_ERROR;
   if (Tcl_InitStubs(interp, TCL_VERSION, 0) != NULL) {
      if (Tcl_PkgProvide(interp, "svn", "1.0") != TCL_ERROR) {
         svn_t = (struct _tclsvn *)Tcl_Alloc(sizeof(struct _tclsvn));
         if (svn_t != NULL) {
            svn_t->client = 0;
            svn_t->interp = interp;
            Tcl_CreateObjCommand(
                  interp, "svn", init_svn, (ClientData)svn_t, delete_svn);
            retval = TCL_OK;
         }
         else {
            error("%s, cannot allocate memory for svn data structure",
                  __func__);
         }
      }
   }

   return retval;
}

